package cn.hxzy.controller;


import cn.hxzy.domain.Choose;
import cn.hxzy.domain.Exercises;
import cn.hxzy.response.R;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author niuyi
 * @since 2024-06-22
 */
@RestController
@RequestMapping("/exercises")
public class ExercisesController {

    //新增习题(通过type来选择是单选还是多选)
    @PostMapping("/insertExercise")
    public R insertExercise(@RequestBody Exercises exercises) {
        return R.success("新增成功");
    }


    //搜索框查询习题
    @GetMapping("/selectExercise")
    public R selectExercise(@RequestParam String exercisesName,@RequestParam Integer sectionId) {
        return R.success(new ArrayList<Exercises>());
    }

    //查看习题列表
    @GetMapping("selectExerciseList")
    public R selectExerciseList(@RequestBody Integer sectionId) {
        return R.success(new ArrayList<Exercises>());
    }

    /**
     * 预览本节习题列表
     * @param exerciseId
     * @return
     */
    @GetMapping("/shouExercise")
    public R shouExercise(@RequestParam Integer exerciseId){
        return null;
    }

    //修改习题名称
    @PatchMapping("/change")
    public R change(@RequestParam String exercisesName,@RequestParam Integer exercisesId) {
        return R.success("修改成功");
    }

    //删除习题
    @GetMapping("/delete")
    public R delete(@RequestParam Integer exercisesId) {
        return R.success("删除成功");
    }

}

